
6
6
.
.
2
2
X
X
C
C
o
o
d
d
e
e
-
-
A
A
p
p
p
p
l
l
i
i
c
c
a
a
t
t
i
i
o
o
n
n
G
G
e
e
n
n
e
e
r
r
a
a
t
t
e
e
d
d
C
C
o
o
d
d
e
e
When you create new Project, generated code is actually a (explained in View Operations)
● struct ContentView (that implements View Protocol)
● with a Computed Property body (of Data Type some View that only has a getter)
Generated code
struct ContentView : View {
var body : some View { Text("Hello World") } //Computed Property : Data Type { getter code }
}
Explicit getter & return
struct ContentView : View {
var body : some View { get { return Text("Hello World") } }
}
C
C
r
r
e
e
a
a
t
t
e
e
A
A
p
p
p
p
l
l
i
i
c
c
a
a
t
t
i
i
o
o
n
n
Start XCode - Create a new XCode project (File - New - Project)
iOS - Application - Single View - Product Name: TestApp - User Interface: SwiftUI - Folder: \HOME MADE\XCode SwiftUI
R
R
u
u
n
n
A
A
p
p
p
p
l
l
i
i
c
c
a
a
t
t
i
i
o
o
n
n
Run in Simulator
– Choose Simulator - Run
– Hardware (Rotate Left/Right, Orientation, Home)
– Screenshots (From XCode 11.4 use Ctrl + Command + C to Save frameless Screenshots to Clipboard)
Run in Preview (automatically updates as you code)
– Resume (by default only shows Layout changes)
– Live Preview Arrow (allows interaction: print inside button action doesn't work)
– Adjust Editor Options (Show Editor Only, Canvas, Layout: Right, Bottom)
Automatic Preview - Landscape (no iPhone frame)
ContentView().previewLayout(.fixed(width: 900, height: 450))
A
A
p
p
p
p
l
l
i
i
c
c
a
a
t
t
i
i
o
o
n
n
S
S
e
e
t
t
t
t
i
i
n
n
g
g
s
s
Import Images Assets - Drag & Drop Files & Folders from Finder (+ - Import…)
Change Icon Assets - AppIcon - Drag & Drop icons from Finder
Change Name Select Project Name (Project Settings) - Tab: General - Section: Identity - Display Name: TestApp
Change Starting Screen SceneDelegate.swift - let contentView = SnapshotsView()